package com.ganbo.demo;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author ganbo
 * @date 2022/10/19 10:28
 */
@SpringBootApplication
public class DemoApplication implements ApplicationRunner {


    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(DemoApplication.class, args);
        Object userInnodb = run.getBean("userInnodb");
        System.out.println("=============>" + userInnodb);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("需要在springBoot项目启动时执行的代码---");
    }
}
